package day7;

import java.util.HashMap;
import java.util.Hashtable;
import java.util.Iterator;
import java.util.Map;

public class TestMap {
    public static void main(String[] args) {
        Map<String,Integer> map = new HashMap<>();
        Map<String,Integer> map2 = new Hashtable<>();
        map.put(null,100);
        map.put("java",null);
        map.put(null,null);
        Iterator<Map.Entry<String,Integer>> it = map.entrySet().iterator();//间接使用迭代器
        while (it.hasNext()){
            Map.Entry<String,Integer> e =it.next();
            String key = e.getKey();
            Integer value =e.getValue();
            System.out.println(key+"====="+value);
        }
    }
}
